package com.lakala.sh.zf.openplatform.common;

import java.util.Random;

/**
 * @Author peijian
 * @Date 2021/1/18 17:06
 * @Version 1.0
 */
public class RandomUtils {

    public static String generateString(int length) {
        StringBuffer sb = new StringBuffer();
        Random random = new Random();

        for(int i = 0; i < length; ++i) {
            sb.append("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(random.nextInt("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".length())));
        }

        return sb.toString();
    }
}
